package com.happy3w.ssp.schoolmatehome.service.user;

import com.happy3w.ssp.schoolmatehome.entity.User;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

@Builder
@AllArgsConstructor
@Data
public class UserInfo {
    private Long id;
    private String name;
    private String phone;
    private String email;
    private String avatar;

    public static UserInfo from(User user) {
        return UserInfo.builder()
                .id(user.getId())
                .name(user.getName())
                .phone(user.getPhone())
                .email(user.getEmail())
                .avatar(user.getAvatar())
                .build();
    }
}
